<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
<title>字符^的使用</title>
</head>
<body>
   <h3>行首匹配字符^的使用</h3>
   <script type="text/javascript">
   <!--
      var reg_expression = /^ming/;  				//使用行首元字符
      var textString="mingrisoft";
      var result=reg_expression.test(textString);  	//匹配时返回true,否则false
      document.write("<font size='+1'>"+result+"<br>");
      if(result){
          document.write("正则表达式/^ming/匹配字符串\""+ textString +"\".<br>");
      }
      else{
          alert("未找到匹配的模式!");
      }
   // -->
   </script>
</body>
</html>

